how to check if number is negative in javascript